<template>
  <n-drawer class="goods-info" v-model:show="goodsInfoDrawerActive" width="90%">
    <n-drawer-content body-style="--n-body-padding:0" closable>
      <template #header>
        <p class="my-title--primary">订单信息</p>
      </template>
      <div class="i-order">
        <div class="i-order_item">
          <span>出库编号：3233242424234234</span>
        </div>
        <div class="i-order_item">
          <span>出库时间：3233242424234234</span>
        </div>
        <div class="i-order_item">
          <span>订单状态：部分出库</span>
        </div>
        <div class="i-order_item">
          <span>订单编号：312312312312</span>
        </div>
        <div class="i-order_item">
          <span>订单总数：123件</span>
        </div>
        <div class="i-order_item">
          <span>本次订单数量：123件</span>
        </div>
        <div class="i-order_item" @click="expressInfoModalActive = true">
          <span>物流信息：</span>
          <span style="color: #1981F4;">顺丰-saadasddadasd</span>
        </div>
      </div>
      <p class="i-title">商品信息</p>
      <div class="i-goods-item">
        <div class="i-goods-item_header">
          <div class="h_left">
            <p class="h_left--name">b1-23带腿带袖体雕衣</p>
            <p class="h_left--alias">b1-23带腿带袖体雕衣</p>
          </div>
          <div class="h_right">
            <div class="h_right__item">
              商品数量：6件
            </div>
            <div class="h_right__line"></div>
            <div class="h_right__item">
              积分：0
            </div>
            <div class="h_right__line"></div>
            <div class="h_right__item">
              零售价：￥12334
            </div>
          </div>
        </div>
      </div>
      <div class="i-table">
        <stock-table :list="['', 'A', 'B', 'C', '紫色', 0, 2, 3, '肤色', 4, 5, 6, '黑色', 7, 8, 9]"></stock-table>
        <stock-table isInput :list="['',
        { value: 'A', },
        { value: 'B', },
        { value: 'C', },
        { value: '紫色', },
        { value: 1, change: true },
        { value: 2, change: true },
        { value: 3, change: true },
        { value: '肤色', },
        { value: 4, change: true },
        { value: 5, change: true },
        { value: 6, change: true },
        { value: '黑色', },
        { value: 7, change: true },
        { value: 8, change: true },
        { value: 9, change: true }]"></stock-table>
        <stock-table takeStock :list="['',
        { value1: 'A', },
        { value1: 'B', },
        { value1: 'C', },
        { value1: '紫色', },
        { value1: 1, value2: 10 },
        { value1: 2, value2: 10 },
        { value1: 3, value2: 10 },
        { value1: '肤色', },
        { value1: 4, value2: 10 },
        { value1: 5, value2: 10 },
        { value1: 6, value2: 10 },
        { value1: '黑色', },
        { value1: 7, value2: 10 },
        { value1: 8, value2: 10 },
        { value1: 9, value2: 10 }]"></stock-table>
      </div>
      <template #footer>
        <div class="i-footer">
          <div class="i-footer_item">
            本次订单数量：23123件
          </div>
          <div class="i-footer_line"></div>
          <div class="i-footer_item">
            合计积分：￥23123
          </div>
          <div class="i-footer_line"></div>
          <div class="i-footer_item">
            合计总零售价：￥23123
          </div>
          <button class="my-btn--primary">一键入库</button>
        </div>
      </template>
    </n-drawer-content>
  </n-drawer>
  <slot></slot>
</template>

<script setup>
import {
  ref,
  inject,
  provide,
  reactive
} from "vue";

import stockTable from "../@fragment/stock-table.vue";
const goodsInfoDrawerActive = inject('goodsInfoDrawerActive');
let expressInfoModalActive = ref(false);
provide('expressInfoModalActive',expressInfoModalActive);

</script>

<style lang="less" scoped>
.goods-info {
  .i-order {
    display: grid;
    grid-template-columns: 40% 30% 30%;
    grid-template-rows: repeat(3, 33.33%);
    width: 1590px;
    height: 128px;
    padding: 20px 30px;
    margin: 20px;
    background: #f8f8f8;
    border-radius: 4px;

    &_item {
      margin: 10px 0;
      font-size: 24px;
      font-weight: 500;
      color: #4a5060;
    }
  }

  .i-title {
    position: relative;
    padding-left: 30px;
    font-size: 28px;
    font-weight: 500;
    color: #4a5060;

    &::before {
      position: absolute;
      top: 12px;
      left: 15px;
      content: "";
      width: 6px;
      height: 24px;
      background: #373b4f;
    }
  }

  .i-table {
    margin: 0 30px;
  }

  .i-goods-item {
    margin-left: 30px;
    margin-right: 60px;

    &_header {
      display: flex;
      justify-content: space-between;
      margin: 30px 0;

      .h_left {
        &--name {
          font-size: 24px;
          font-weight: 500;
          color: #2e323d;
        }

        &--alias {
          font-size: 20px;
          font-weight: 500;
          color: #4a5060;
        }
      }

      .h_right {
        display: flex;
        justify-content: space-evenly;
        align-items: center;
        height: 60px;
        padding: 0 30px;
        font-size: 24px;
        font-weight: bold;
        color: #666;
        background: #f7f7f7;
        border-radius: 5px;

        &__item {
          margin: 0 10px;
        }

        &__line {
          width: 1px;
          height: 30px;
          margin: 0 20px;
          background: #d8d8d8;
        }
      }
    }
  }

  .i-table {
    margin: 20px 40px 20px 20px;
  }

  .i-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;

    &_item {
      margin: 0 20px;
      font-size: 26px;
    }

    &_line {
      width: 1px;
      height: 30px;
      margin: 0 20px;
      background: #d8d8d8;
    }

    >button {
      margin-left: 30px;
    }
  }
}
</style>